#ifndef _distance_hpp_
#define _distance_hpp_

/** \file distance.hpp Defines the \a distance method which works with scalars and vectors of static or dynamic dimension.
 *  \author Adrian Schweizer
 *  \date   8.7.2007
 */

#include "detail/distance_2_impl.hpp"

namespace core {

    namespace math {

        template<class V>
            typename field<V>::type   distance_2(const V& v1, const V& v0)
            {
                typedef typename detail::choose_distance_2_impl<V>::type    impl_type;
                return impl_type::eval(v1,v0);
            }


        /** \brief the distance function induced by the \f$ || \cdot ||_2 \f$ norm*/
        template<class V>
            typename field<V>::type   distance(const V& v1, const V& v0)
            {
                return distance_2(v1,v0);
            }


    } // namespace math

} // namespace core

#endif // _distance_hpp_
